//
//  SYMyHomeHeaderView.m
//  BSHOUYIFANG
//
//  Created by lanou on 15/8/21.
//  Copyright (c) 2015年 CYB. All rights reserved.
//

#import "SYMyHomeHeaderView.h"

@implementation SYMyHomeHeaderView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _iconButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _iconButton.frame = CGRectMake(frame.size.width / 2 - frame.size.height / 4, frame.size.height / 4, frame.size.height / 2, frame.size.height / 2);
        [_iconButton setBackgroundImage:[UIImage imageNamed:@"circle_default_face@2x"] forState:UIControlStateNormal];
        _iconButton.layer.cornerRadius = frame.size.height / 4;
        _iconButton.layer.masksToBounds = YES;
        [self addSubview:_iconButton];
        
        _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0 , frame.size.height - 30, frame.size.width, 20)];
        _nameLabel.text = @"用户名";
        _nameLabel.textColor = [UIColor whiteColor];
        _nameLabel.font = [UIFont systemFontOfSize:18];
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_nameLabel];
        
        self.image = [UIImage imageNamed:@"user_home_page_header@3x"];
    }
    return self;
}




@end
